package com.qfedu.cardlikelazy.controller;

import com.qfedu.cardlikelazy.domain.Card;
import com.qfedu.cardlikelazy.response.R;
import com.qfedu.cardlikelazy.service.CardService;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("card")
@Api(value = "名片操作" , tags = "名片操作")
public class CardController {

    @Resource
    private CardService service;

    @PostMapping("insert")
    public R insert(Card card){
        return service.insert(card);
    }

    @GetMapping("one")
    public R selectByOne(int id){
        return service.selectById(id);
    }

    @GetMapping("/list")
    public R selectAll(){
        return service.selectAll();
    }



}
